function onChange(movies){
  var change = "";
  for(let i in movies){
    change = change + movies[i].name + '/ ';
  }
  return change.substring(0, change.length -2);
}

function changeCastsArray(movies){
  var castsArray = [];
  for(let i in movies){
    var casts = {
      img: movies[i].avatars ? movies[i].avatars.large : " ",
      name: movies[i].name
    }
    castsArray.push(casts);
  }
  return castsArray;
}

export{
  onChange,
  changeCastsArray
}